<?php
include 'secure/core.php';

?>
<?php 
if(isset($_POST['submit'])){
	        $result = $users->addUser($_POST);
	        if($result == 1){
		header( 'Location: add_user.php?msg=1' ) ;					
		exit;
	        } else {
		header( 'Location: add_user.php?msg=2' ) ;	
		exit;
	        }		

}
include 'header.php';
include 'left.php';
?>

		<div id="right">
		<div class="section">
		<?php if($_GET['msg'] == '1') { ?>
		<div class="message green"><span><b>Success</b>: User has been registered</span></div>
		<?php } ?>
		<?php if($_GET['msg'] == '2') { ?>
		<div class="message red"><span><b>Error</b>: Error adding user.</span></div>
		<?php } ?>
				<div class="box">
					<div class="title">
						Add New User
						<span class="hide"></span>
					</div>
					<div class="content">
						<form action="add_user.php" method="POST">
						        <div class="row">
								<label>Real Name</label>
								<div class="right"><input type="text" name="name" value=""></div>
							</div>
							<div class="row">
								<label>Username</label>
								<div class="right"><input type="text" name="username" value=""></div>
							</div>
							<div class="row">
								<label>Email</label>
								<div class="right"><input type="text" name="email" value=""></div>
							</div>
							<div class="row">
								<label>Address</label>
								<div class="right"><input type="text" name="address" value=""></div>
							</div>
							<div class="row">
								<label>Contact Num</label>
								<div class="right"><input type="text" name="contact" value=""></div>
							</div>
							<div class="row">
								<label>Password</label>
								<div class="right"><input type="text" name="password" value=""></div>
							</div>
							<div class="row">
								<label>Country</label>
								<div class="right"><?php echo $users->getCountrySelectBox($row['country_iso']);?></div>
							</div>
							<div class="row">
								<label>Send Activation Email</label>
								<div class="right">
									<select class="ui-selectmenu ui-widget ui-state-default ui-selectmenu-dropdown ui-state-active ui-corner-top" name="activation">
										<option value="1">Yes</option>
										<option value="2">No</option>
									</select>
								</div>
							</div>
							<div class="row">
								<div class="right">
								<button type="submit" class="green" name="submit"><span>Update</span></button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

<div id="footer">
			<div class="split">Copyright &#169; 2012 - <?php echo $file_path.$file_name; ?> <a href="index.html">Paid4Upload</a>.</div>
			<div class="split right"><a href="http://www.paid4upload.com/forums">Forums</a> | <a href="tos.php">Terms of Service</a> | <a href="dmca.php">DMCA</a></div>
		</div>
	</div>
</div>

</body>


</html> 